<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="d" uri="http://dgg.net/jsp/jstl/core" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html>
<html>
<head>
    <title>团队退单驳回</title>
    <jsp:include page="../../header.jsp"/>
    <style>
        table.crm-table.cell-border tbody td{
            white-space: nowrap;
        }
    </style>
</head>
<body>
<div class="body-main">
    <div>
        <div class="titleSearch">
            <div class="layui-inline">
                <label>业务类型：</label>
                <div class="layui-input-inline">
                    <div id="business_typeCode" style="width: 180px;">
                        <input type="hidden" name="typeCodeId" class="plug-in-msg"/>
                        <input type="hidden" name="typeCode" id="typeCode" class="plug-in-code"/>
                        <input type="text" readonly placeholder="请选择业态" class="chose-plugIn layui-input"
                               name="businessName">
                        <div class="bus-picker">
                            <div class="bus-picker-tab">
                                <a href="javascript:void(0);" class="active">请选择业态</a>
                            </div>
                            <div class="bus-picker-content"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-inline">
                <label>流程人员：</label>
                <div class="layui-input-inline select2-inline">
                    <select class="select-style" name="flowUserId" id="flowUserId" divisionUser-select-law>
                        <option value>请选择</option>
                    </select>
                </div>
            </div>
            <div class="layui-inline">
                <label>电话号码：</label>
                <div class="layui-input-inline">
                    <input type="text" class="input-style" placeholder="精确查找" id="customerPhone" name="customerPhone">
                </div>
            </div>
            <div class="layui-inline">
                <label>签单时间：</label>
                <div class="layui-inline">
                    <input type="text" name="signTimeStart" placeholder="开始时间" class="Wdate input-style"
                           id="d4311"
                           onFocus="var d4312=$dp.$('d4312'); WdatePicker({onpicked:function(){d4312.focus();}, maxDate:'#F{ $dp.$D(\'d4312\')}', dateFmt:'yyyy-MM-dd'})">
                </div>
                <span>~</span>
                <div class="layui-inline">
                    <input type="text" name="signTimeEnd" placeholder="结束时间" class="Wdate input-style"
                           id="d4312"
                           onFocus="WdatePicker({minDate:'#F{$dp.$D(\'d4311\')}', dateFmt:'yyyy-MM-dd'})">
                </div>
            </div>

            <div class="layui-inline" style="margin-left: 12px">
                <label>关键字：</label>
                <div class="layui-input-inline">
                    <input type="text" class="input-style" style="width: 200px;" placeholder="客户名称/生产订单编号/订单编号"
                           maxlength="50"
                           id="keyWords"
                           name="keyWords">
                </div>
            </div>
            <div class="layui-inline">
                <button class="layui-btn layui-btn-mini layui-btn-normal" onclick="dataTableReload()">搜索</button>
                <button class="layui-btn layui-btn-mini layui-btn-primary" onclick="cleanSearch()">清空</button>
            </div>
        </div>
        <div class="table-conter">
            <div class="fr other-span">
                <div class="fr">
                    <span class="bgRed">订单超期</span>
                    <span class="bgBlue">节点超期</span>
                </div>
            </div>
            <div class="dataTables_wrapper no-footer">
                <!--表格 end-->
                <table class="cell-border crm-table columnsHidden" id="chargeBackTable">
                    <thead>
                    <tr>
                        <th width="20"><input type="checkbox" class="checkall"/></th>
                        <th width="60">序号</th>
                        <th width="60">订单来源</th>
                        <th width="100">生产订单编号</th>
                        <th width="100">订单编号</th>
                        <th width="100">当前完成节点</th>
                        <th width="130">客户</th>
                        <th width="80">业务类型</th>
                        <th width="80">订单产品</th>
                        <th width="130">签单时间</th>
                        <th width="130">最新备注</th>
                        <th width="130">签单人员</th>
                        <th width="130">流程人员</th>
                        <th width="100">操作</th>
                    </tr>
                    </thead>
                </table>
            </div>
        </div>
    </div>
    <jsp:include page="/WEB-INF/jsp/footer.jsp"/>
    <script type="text/javascript"
            src="${basePath}/static/js/zzsc/production/sc_business.js?v=${version}"></script>
    <script type="text/javascript"
            src="${basePath}/static/js/zzsc/production/sc_common.js?v=${version}"></script>
    <script type="text/javascript"
            src="${basePath}/static/js/zzsc/production/sc_divisionUser.js?v=${version}"></script>
    <script type="text/javascript"
            src="${basePath}/static/js/choose.extend.js?v=${version}"></script>
    <script type="text/javascript"
            src="${basePath}/static/js/zzsc/inprocess/inprocess_list.js?v=${version}"></script>
    <script type="text/javascript" src="${basePath}/static/js/zzsc/common/call_common.js?v=${version}"></script>
    <script type="text/javascript">
        Plug.plug_in("post", "${basePath}/zzsc/common/tree_book_list.do?code=BUS_YT_ZZ&&type=2&&level=2", "#business_typeCode", '选择业态', '', true, 'BUS_YT_ZZ', '', '');
    </script>
    <script type="text/javascript" charset="utf-8">
        var table;
        $(document).ready(function () {
            //初始化dataTable列表
            table = $('#chargeBackTable').dataTableExtend({
                "ajax": {
                    "url": "${basePath}/zzsc/audit/team_chargeback_rejected_list_data.do",
                    "type": "post"
                },
                "fnServerParams": function (aoData) {
                    aoData = $.extend(aoData, getSearchData());
                    return aoData;
                },
                "scrollX": "true",//是否开启横项滚动
                "fixedColumns": {//锁定列，只有开启scrollX时才生效
                    "leftColumns": 4,//左侧锁定2列
                    "rightColumns": 1//右侧锁定1列
                },
                "aoColumns": [
                    {
                        "orderable": false,
                        "data": "id",
                        "render": function (data, type, full, meta) {
                            return '<input type="checkbox"  name="ids" class="checkchild"  value="' + data + '" />';
                        }
                    }
                    , {
                        "orderable": false,
                        "render": function (data, type, full, meta) {
                            return meta.row + 1;
                        }
                    }, {
                        //订单来源
                        "orderable": false,
                        "data": "signOrgName"
                    }, { //生产订单编号
                        "orderable": false,
                        "data": "scProductOrderNo",
                        "render": function (data, type, row) {
                            {
                                return '<a href="javascript:;"  class="layui-table-link" onclick="openOrderInfoDetail(\'' + row.scProductOrderNo + '\',\'' + row.id + '\')" /><p>' + data + '</p></a>';
                            }
                        }
                    }, {
                        //订单编号
                        "orderable": false,
                        "data": "orderNo",
                        "render": function (data, type, full, meta) {
                            return ('<a href=\'javascript:void(0)\' ti  onclick="openBusinessDetail(\'' + full.orderNo + '\',\'' + full.orderId + '\')" /><span class="layui-table-link">' + data + '</span></a>&nbsp;');
                        }
                    }, {
                        "orderable": false,
                        "data": "latestEndNodeName"
                    }, {
                        "orderable": false,
                        "data": "customerName",
                        "render": function (d, type, r) {
                            return emptyStringConvert(d) + '<p>' + emptyStringConvert(r.customerPhone) + '</p>';
                        }
                    }, {//业务类型
                        "orderable": false,
                        "data": "businessProductName"
                    }, {
                        "orderable": false,
                        "data": "productName"
                    }, {
                        "orderable": false,
                        "data": "receiveOrderDate"
                    },{//最新备注时间
                        "orderable": true,
                        "data": "lastRemarkTime",
                        "render": function (d, type, r) {
                            (d==null)&&(d='');
                            (r.lastRemark==null)&&(r.lastRemark='');
                            return '<div class="line2" style="min-width: 120px" title="'+r.lastRemark+'">'+r.lastRemark+'</div> '
                                + '<p>' + d + '</p>';
                        }
                    },{//签单商务
                        "orderable": false,
                        "data": "signUserName",
                        "render": function (d, type, r) {
                            (d==null)&&(d='');
                            (r.signUserOrgName==null)&&(r.signUserOrgName='');
                            return d+ '<p>' + r.signUserOrgName + '</p>';
                        }
                    }, { //流程人员
                        "orderable": false,
                        "data": "flowUserName",
                        "render": function (d, type, r) {
                            (d==null)&&(d='');
                            (r.flowUserOrgName==null)&&(r.flowUserOrgName='');
                            return d+ '<p>' + r.flowUserOrgName + '</p>';
                        }
                    }, {
                        "orderable": false,
                        "data": "id",
                        "render": function (d, type, r, meta) {
                            var result = "";
                            result += '<a href=\'javascript:void(0)\' ti  onclick="callPhoneByProduction(\'' + r.id + '\')" /><span style="color: #0066ff; font-weight: bold ">打电话</a>&nbsp;&nbsp;&nbsp;';
                            result += '<a href=\'javascript:void(0)\' class="layui-table-link" onclick="remarkLayer(\'' + r.id + '\')" /><span style="color: #0066ff; font-weight: bold ">备注</a>&nbsp;';
                            return result;
                        }
                    }
                ], "columnDefs": [{
                    targets: [2], //第1，2，3列
                    createdCell: function (td, cellData, rowData, row, col) {
                        var nodestatus = rowData.nodeTimeStatus;
                        var orderstatus = rowData.orderTimeStatus;
                        if ("OVERDUE_STATE2" == orderstatus) {
                            $(td).parent().addClass("bgRed");
                            return;
                        }
                        if ("OVERDUE_STATE2" == nodestatus) {
                            $(td).parent().addClass("bgBlue");
                            return;
                        }
                    }
                }, {
                    targets: ["_all"], "defaultContent": ""
                }]
            });

        })
        ;


        // 获取搜索数据
        function getSearchData() {
            return $('.titleSearch').serializeJson();
        }

        //刷新表格
        function dataTableReload() {
            $('#chargeBackTable').dataTableExtend("reloadFalse");
        }
    </script>
</div>
</body>
</html>
